#ifndef _WT_UTIL_H
#define _WT_UTIL_H

char *WtToString(Tcl_Obj *obj);
Tcl_Obj *WtNewString(const char *val);
Tcl_Obj *WtNewBool(int val);
int WtGetListSize(Tcl_Obj *list);
Tcl_Obj *WtGetFirstListElement(Tcl_Obj *list);
void WtAppendToList(Tcl_Obj *list, Tcl_Obj *val);
void WtAppendListToList(Tcl_Obj *target, Tcl_Obj *list);
Tcl_Obj *WtGetListItem(Tcl_Obj *list, int i);
void WtReplaceInList(Tcl_Obj *list, int start, int count,
                     int objc, Tcl_Obj *const objv[]);
void WtApLog(const char *file, int line, int level, WtContext *w,
             const char *fmt, ...);
char *WtSafeStr(const char *str);
void WtPrintTclError(WtContext *w, Tcl_Interp *interp);

#define DEBUG1(str) (WtApLog(##APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, \
                             WtGetContext(), str))

#endif /* !_WT_UTIL_H */
